{% extends 'base.html' %}

{% block content %}
<div class="container mt-4">
    <h5><strong>{{ student.name }}</strong>同学{{ strdate }}在校表现情况：</h5>
    
    <div class="card mt-3">
        <div class="card-header">
            <i class="bi bi-clipboard-check me-2"></i>考勤情况
        </div>
        <div class="card-body">
            {% if attendance_records %}
            <p class="card-text">日期: {{ attendance_records.date }}</p>
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>上午出勤状态</th>
                        <th>下午出勤状态</th>
                        <th>晚自习出勤状态</th>
                        <th>劳动任务</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="{% if attendance_records.morning_attendance == False %}text-success{% else %}text-danger{% endif %}">{% if attendance_records.morning_attendance == False %}出勤{% else %}缺勤{% endif %}</td>
                        <td class="{% if attendance_records.afternoon_attendance == False %}text-success{% else %}text-danger{% endif %}">{% if attendance_records.afternoon_attendance == False %}出勤{% else %}缺勤{% endif %}</td>
                        <td class="{% if attendance_records.evening_attendance == False %}text-success{% else %}text-danger{% endif %}">{% if attendance_records.evening_attendance == False %}出勤{% else %}缺勤{% endif %}</td>
                        <td class="{% if attendance_records.cleaning_task_completed == False %}text-success{% else %}text-danger{% endif %}">{% if attendance_records.cleaning_task_completed == False %}完成{% else %}未完成{% endif %}</td>
                    </tr>
                </tbody>
            </table>
            {% else %}
            <p class="card-text">无考勤记录</p>
            {% endif %}
        </div>
    </div>

    <div class="card mt-3">
        <div class="card-header">
            <i class="bi bi-book me-2"></i>作业情况
        </div>
        <div class="card-body">
           
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>学科</th>
                        <th>作业内容</th>
                        <th>状态</th>
                    </tr>
                </thead>
                <tbody>
                     {% for item in homework_submissions %}
                    <tr>
                        <td>{{item.homework.class_subject.subject.name}}</td>
                        <td>{{item.homework.content}}</td>
                        <td class="{% if item.status in 'plagiarism,missing' %}text-danger{% else %}text-success{% endif %}">{{item.get_status_display}}</td>
                    </tr>
                      {% endfor %}
                </tbody>
            </table>
          
        </div>
    </div>
    <div class="card mt-3">
        <div class="card-header">
            <i class="bi bi-calendar-x me-2"></i>请假情况
        </div>
        <div class="card-body">
            <h5 class="card-title">
                {% if leave_days %}
                今日请假：
                {% for item in leave_days %}
                {{item.reason}}
                {% endfor %}
                {% else %}
                无
                {% endif %}
            </h5>
        </div>
    </div>
    <div class="card mt-3">
        <div class="card-header">
            <i class="bi bi-exclamation-triangle me-2"></i>违纪情况
        </div>
        <div class="card-body">
            <h5 class="card-title">
                {% if today_discipline %}
                今日违纪：
                {% for item in today_discipline %}
                {{item.discipline_type.name}}
                {% endfor %}
                {% else %}
                无
                {% endif %}
            </h5>
        </div>
    </div>
    <div class="card mt-3">
        <div class="card-header">
            <i class="bi bi-trophy me-2"></i>荣誉情况
        </div>
        <div class="card-body">
            <h5 class="card-title">
                {% if today_honor %}
                今日荣誉：
                {% for item in today_honor %}
                {{item.honor_type.name}}
                {% endfor %}
                {% else %}
                无
                {% endif %}
            </h5>
        </div>
    </div>
     <div class="card mt-3">
        <div class="card-header">
            <i class="bi bi-star me-2"></i>总体情况评价
        </div>
        <div class="card-body">
            <h5 class="card-title">评价:</h5>
        </div>
    </div>
</div>
{% endblock %}